package com.easy.generator.vue;

import com.easy.generator.Easy;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;

/**
 * @author easy
 * @date 2025年07月11日 16:19
 */
public class App_Generator {
    private static final String DIR_NAME = Easy.VUE_LOCAL_PATH;
    private static final String FILE_NAME = "App.vue";
    private static final String PACKAGE_NAME = Easy.MODEL_PACKAGE+".generator.vue.file";

    public static void generate() throws IOException {
        File srcFile = new File(Easy.PROJECT_ABSOLUTE_URL + Easy.SRC_DIR + Easy.convertPackagePath(PACKAGE_NAME) + "/"+FILE_NAME );
        File destFile = new File(Easy.VUE_LOCAL_PATH + "/src/" + FILE_NAME);
        Easy.mkdirs(Easy.VUE_LOCAL_PATH + "/src/") ;
        Files.copy(srcFile.toPath(), destFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
        System.out.println("已生成文件：" + destFile.getAbsolutePath());
    }
}
